<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page import="com.fit.user.dao.*"  %>
<%@ page import="com.fit.user.entity.*"  %>
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/jquery.inputform.js"></script>
	<link rel="stylesheet" href="css/form.css" type="text/css">
	<link rel="stylesheet" href="css/jquery.inputform.css" type="text/css">
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
	<script type="text/javascript">

	$().ready(function(){
		$("input.select1").inputfile();
		$("input.select2").inputfile({button:"<img src='img/select.gif'>"});
		});
	
	</script>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">

    <title>My JSP 'show.jsp' starting page</title>
  <%
  String[] table={"跟踪事务名称","优先级","事务类别","责任人","当前状态","当前进展","打开时间","关闭时间"};
   %>   
  </head>
  
  
  <body>
  <center>
   <h1>事务跟踪列表_片区B</h1>
  </center>
          当前用户为：<%=session.getAttribute("userName")%>
   <hr>
		<table border="1" cellpadding="0" cellspacing="0">
		<tr>
		<% int i =0; int j = 0;%>
		<c:forEach var="name" items="<%=table %>">
			<!--  <td>${name }</td>  -->
			<td> <%=table[i] %></td>
			<% i++; %>
		</c:forEach>
		</tr>
		<% 
		UsersDAO user = new UsersDAO();
		List<UserEntity> list = user.getAll();
	
		
		 %>
		 <form action="users.do?operator=export" method="post">
		 文件名：<input type="text" style='width:200px' name="ue.exportFileName">
		 <input type = "submit" value = "导出"  style='width:100px'>默认路径：E:\\事务管理\\
		 </form>
		 <c:forEach var="name" items="<%=list %>">
		 <tr>
			<!--  <td>${name }</td>  -->
			<% UserEntity ue =(UserEntity)list.get(j);%>
			
			<td width ='260px'><%= ue.getAffairName()%> </td>
			<td width ='70px'><%= ue.getPRI()%> </td>
			<td width ='90px'><%= ue.getAffairType()%> </td>
			<td width ='70px'><%= ue.getDutyMan()%> </td>
			<td width ='70px'><%= ue.getCurrentState()%> </td>
			<td width ='260px'><%= ue.getCurrentEvole()%> </td>
			<td width ='70px'><%= ue.getOpenTime()%> </td>
			<td width ='70px'><%= ue.getCloseTime()%> </td>
			<%
			Object object = session.getAttribute("userName");
			if(object != null &&object.toString().equals(ue.getDutyMan()))
			{
			%>
			<td><a href="users.do?operator=delete&userId=<%=ue.getUserId() %>">删除</a></td>			
			<td><a href="modify.jsp?userId=<%=ue.getUserId() %>">修改</a></td>
			<%
			}
			 %>

			<%j++; %>
			</tr>
		</c:forEach>
		
		<!-- 
			<c:forEach var="user" items="${list}">
				<tr>
				<td>${user.userName }</td>
				<td>${user.userPassword }</td>
				<td>${user.registerDate }</td>
				<td><a href="users.do?operator=delete&userId=${user.userId }">Delete</a></td>
				</tr>
			</c:forEach>
		-->
		</table>    
		<center><a href = "addfair.jsp">添加事务</a></center>
	
  </body>
</html>
